<?php

namespace yunj\control\field;

class Markdown extends YunjField {

    private static $instance;

    public static function instance() {
        if (!self::$instance instanceof self) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    protected function defineExtraArgs() {
        return [
            'mode' => 'editormd',         // 模式（可选值：editormd（默认））
            "mode_config" => [            // 模式的配置
                "editormd" => [
                    "height" => 250,
                    "watch" => false,
                    "placeholder" => "此处开始编写...",
                    "image_formats" => explode(",", yunj_config('file.upload_img_ext')),
                    "toolbar" => [
                        "undo", "redo", "|", "bold", "del", "italic", "quote", "|"
                        , "h1", "h2", "h3", "h4", "|", "list-ul", "list-ol", "hr", "|"
                        , "align-left", "align-center", "align-right", "align-justify", "|"
                        , "table", "datetime", "html-entities", "pagebreak", "code", "code-block", "|"
                        , "link", "reference-link", "image", "video", "|"
                        , "watch", "preview", "fullscreen", "clear", "search", "|", "help"
                    ]
                ],
            ],
            'readonly' => false,        // 只读
        ];
    }

}